package com.lgq.demo.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.sun.deploy.net.HttpRequest;
import org.apache.log4j.Logger;

import javax.servlet.http.HttpServletRequest;


/**
 * Created by liguoqing on 2016/5/6.
 */
public class LoginCheckInterceptor implements Interceptor {

    private static final Logger logger = Logger.getLogger(LoginCheckInterceptor.class);


    @Override
    public void intercept(Invocation inv) {
        Controller invokeController = inv.getController();
        HttpServletRequest req = invokeController.getRequest();

        // 如果没有登陆就转到登陆页面
//        if() {
//
//            invokeController.forwardAction("");
//            return;
//        }

        inv.invoke();
    }


}
